<%@page import="java.util.List"%>
<%@page import="com.itwill.ecom.member.MemberBeans"%>
<%@page import="com.itwill.ecom.member.MemberService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@ page language="java" contentType="text/plain; charset=UTF-8" pageEncoding="UTF-8"%>

<%
	System.out.println("△get_memberlistJSON요청△");

	WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(application);
	MemberService memberService = (MemberService)webApplicationContext.getBean("memberService");
	
	List<MemberBeans> memberBeansList = memberService.getMemberList();

%>

[
<%
	int count=0;
	for(MemberBeans memberBeans : memberBeansList){
%>
		{
			"member_no" : "<%=memberBeans.getMember_no() %>",
			"member_id" : "<%=memberBeans.getMember_id() %>",
			"member_password" : "<%=memberBeans.getMember_password() %>",
			"member_name" : "<%=memberBeans.getMember_name() %>",
			"member_birth" : "<%=memberBeans.getMember_birth() %>",
			"member_zip" : "<%=memberBeans.getMember_zip() %>",
			"member_addr1" : "<%=memberBeans.getMember_addr1() %>",
			"member_addr2" : "<%=memberBeans.getMember_addr2() %>",
			"member_phone" : "<%=memberBeans.getMember_phone() %>",
			"member_email" : "<%=memberBeans.getMember_email() %>",
			"member_grade" : "<%=memberBeans.getMember_grade() %>",
			"member_nickname" : "<%=memberBeans.getMember_nickname() %>",
			"member_status" : "<%=memberBeans.getMember_status() %>"
}
<%
		if((count+1) != memberBeansList.size()){
			out.print(",");
		}
		count++;
	}
%>
]
